<template>
  <div>
    <div class="banner" @click="handleBannerClick">
      <img class="banner-img" src="//img1.qunarzz.com/sight/p0/1805/7d/7dca9c37a87479eba3.img.jpg_600x330_77f48209.jpg" alt="">
      <div class="banner-number">
        <span class="banner-icon iconfont">&#xe626;</span>
        <span class="banner-num">17</span>
      </div>
      <div class="banner-title">世茂云上厦门观光厅</div>
    </div>
    <fade>
      <common-gallary
        :imgList="imgList"
        v-show="showGallary"
        @close="handleBannerClose"
      ></common-gallary>
    </fade>
  </div>
</template>

<script>
import CommonGallary from 'common/gallary/Gallary'
import Fade from 'common/fade/Fade'

export default {
  name: 'DetialBanner',
  data () {
    return {
      imgList: [
        'http://img1.qunarzz.com/sight/p0/1805/7d/7dca9c37a87479eba3.img.jpg_r_800x800_356628f6.jpg',
        'http://img1.qunarzz.com/sight/p0/1805/d3/d39c87bf374741a4a3.img.png_r_800x800_12abbe76.png',
        'http://img1.qunarzz.com/sight/p0/1412/36/4e213ef62e6a92f1d546bc1503ba3c22.water.jpg_r_800x800_27989b19.jpg'
      ],
      showGallary: false
    }
  },
  methods: {
    handleBannerClick () {
      this.showGallary = true
    },
    handleBannerClose () {
      this.showGallary = false
    }
  },
  components: {
    Fade,
    CommonGallary
  }
}
</script>

<style scoped lang="less">
.banner{
  position: relative;
  /*overflow: hidden;*/
  height: 0;
  padding-bottom: 55%;
  .banner-img{
    width: 100%;
  }
  .banner-title{
    position: absolute;
    bottom: 0.3rem;
    left: 0.2rem;
    line-height: 0.36rem;
    font-size: 0.36rem;
    color: white;
  }
  .banner-number{
    position: absolute;
    bottom: 0.8rem;
    left: 0.2rem;
    width: 1.2rem;
    height: 0.4rem;
    line-height: 0.4rem;
    border-radius: 0.4rem;
    background-color: rgba(0, 0, 0, 0.5);
    font-size: 0.26rem;
    color: white;
    text-align: center;
    .banner-icon{
      font-size: 0.26rem;
    }
    .banner-num{
      padding-left: 0.05rem;
    }
  }
  &::after{
    content: "";
    width: 100%;
    height: 0.6rem;
    position: absolute;
    bottom: 0;
    background-image: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,0.8));
  }
}

</style>
